cmake_minimum_required(VERSION 3.20)

project(xlog)

# 项目名称
message(${PROJECT_NAME})

# 构建库文件
set(BUILD_SHARED_LIBS ON) # 选择构建动态库，OFF为默认值
add_library(xlog xlog.cpp xlog.h)

# 描述系统的变量
message("MSVC = " ${MSVC})
message("WIN32 = " ${WIN32})
message("UNIX = " ${UNIX})
message("CMAKE_SYSTEM_NAME = " ${CMAKE_SYSTEM_NAME})

# 控制构建过程的变量
set(CMAKE_COLOR_MAKEFILE OFF) # 关闭生成makefile时的日志颜色

# cmake 传递变量xlog_STATIC给 c++
add_definitions(-Dxlog_STATIC) # 默认值为1